import request from '@/utils/http'

// 获取用户采购单信息
export function getPurchaseListAPI(buyerId, sellerId, goodId, orderNum) {
    return request({
      url: '/purchase',
      method: 'get',
      params: { buyerId, sellerId, goodId, orderNum }
    })
  }

// order页面提交订单
export function addPurchaseAPI(data) {
    return request({
        url: '/purchase/addPurchase',
        method: 'post',
        data: data,
        headers: {
            "Content-Type":"multipart/form-data"
        }
    })
}

// 更新采购订单
export function updatePurchaseAPI(purchaseId, status) {
    return request({
      url: '/purchase/updatePurchase',
      method: 'put',
      data: { purchaseId, status },
      headers: {
        "Content-Type": "multipart/form-data"
      }
    })
  }